package com.sweetguy.controller;

import com.sweetguy.dto.CoursePageDTO;
import com.sweetguy.es.CourseDoc;
import com.sweetguy.service.CourseService;
import com.sweetguy.vo.CoursePageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/course")
public class CourseController {

    @Autowired
    private CourseService courseService;

    @GetMapping("search")
    public CoursePageVO<CourseDoc> search(@Validated CoursePageDTO dto) {
        return courseService.search(dto);
    }
}
